package basic;

/**
 * @Author: 海琳琦
 * @Date: 2021/8/31 10:44
 */
public class Title26 {
    public static void main(String[] args) {

    }

    private static int removeDuplicates(int[] nums) {
        int n = nums.length;
        if(n==0){
            return 0;
        }else if(n==1){
            return 1;
        }
        int slow=1,fast=1;
        while(fast<n){
            if(nums[fast]!=nums[fast-1]){
                nums[slow] = nums[fast];
                slow++;
            }
            fast++;
        }
        return slow;
    }
}
